package com.lx.zxs.controller;

import com.lx.zxs.entity.User;
import com.lx.zxs.entity.Video;
import com.lx.zxs.service.VideoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@CrossOrigin
@RestController
@RequestMapping("/video")
public class VideoController {
    @Autowired
    private VideoService videoService;

    @GetMapping(value = "/findVideoByPage")
    public List<Video> findVideoByPage(@RequestParam(value = "currentPage",required = false) Integer currentPage,
                                 @RequestParam(value = "vType",required = false) String vType){
        return videoService.findVideoByPage(currentPage,vType);
    }

    @GetMapping(value = "/getVideoCount")
    public Map getVideoCount(@RequestParam(value = "vType",required = false) String vType){
        return videoService.getVideoCount(vType);
    }
}
